﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ServerConfigList.aspx.cs"
    Inherits="LongSpeed.WebSite.Main.ServerConfigList" %>

<%@ Register Assembly="Ext.Net" TagPrefix="ext" Namespace="Ext.Net" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="../../Scripts/admindesktop.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager runat="server" />
    <ext:Viewport runat="server" ID="vpServerConfig" Layout="BorderLayout">
        <Items>
            <ext:Panel Region="North" runat="server" ID="plParentMemu" BaseCls="x-plain" />
            <ext:GridPanel ID="gpServerConfig" runat="server" Region="Center" Height="400">
                <Store>
                    <ext:Store ID="stServerConfig" runat="server" OnRefreshData="RefreshServerConfigData">
                        <Reader>
                            <ext:JsonReader>
                                <Fields>
                                    <ext:RecordField Name="Name" Type="String" />
                                    <ext:RecordField Name="ID" Type="Int" />
                                    <ext:RecordField Name="CPU" Type="String" AllowBlank="false" />
                                    <ext:RecordField Name="RAM" Type="String" AllowBlank="false" />
                                    <ext:RecordField Name="Memo" Type="String" />
                                    <ext:RecordField Name="SortIndex" Type="Int" DefaultValue="0" />
                                    <ext:RecordField Name="IpRange" Type="String" AllowBlank="false" />
                                    <ext:RecordField Name="MemuId" Type="String" AllowBlank="false" />
                                    <ext:RecordField Name="UnitPrice" Type="String" AllowBlank="false" />
                                    <ext:RecordField Name="MonthlyFlow" Type="String" />
                                    <ext:RecordField Name="Broadband" Type="String" AllowBlank="false" />
                                    <ext:RecordField Name="HD" Type="String" AllowBlank="false" />
                                    <ext:RecordField Name="IsSpecials" Type="Boolean" />
                                    <ext:RecordField Name="IsRecommend" Type="Boolean" />
                                    <ext:RecordField Name="LastModifyDate" Type="String" AllowBlank="false" />
                                    <ext:RecordField Name="PromotionalPrice" Type="String" AllowBlank="false" />
                                </Fields>
                            </ext:JsonReader>
                        </Reader>
                        <BaseParams>
                            <ext:Parameter Name="ParentId" Value="aaa" />
                        </BaseParams>
                    </ext:Store>
                </Store>
                <ColumnModel ID="ColumnModel2" runat="server">
                    <Columns>
                        <ext:RowNumbererColumn />
                        <ext:Column Width="100" Header="型号" DataIndex="Name"/>
                        <ext:Column Width="100" Header="CPU" DataIndex="CPU" />
                        <ext:Column Width="100" Header="内存" DataIndex="RAM" />
                        <ext:Column Width="100" Header="硬盘" DataIndex="HD" />
                        <ext:Column Width="100" Header="Ip数" DataIndex="IpRange" />
                        <ext:Column Width="100" Header="排序索引" DataIndex="SortIndex" />
                        <ext:Column Width="100" Header="单价" DataIndex="UnitPrice" />
                        <ext:Column Width="100" Header="月流量" DataIndex="MonthlyFlow" />
                        <ext:Column Width="100" Header="宽带" DataIndex="Broadband" />
                        <ext:CheckColumn Width="60" Header="特价" DataIndex="IsSpecials" />
                        <ext:CheckColumn Width="60" Header="推荐" DataIndex="IsRecommend" />                        
                        <ext:Column Width="100" Header="促销价" DataIndex="PromotionalPrice"/>
                        <ext:Column Width="100" Header="备注" DataIndex="Memo" Hidden="true" />
                        <ext:CommandColumn Width="150" Header="操作">
                            <Commands>
                                <ext:GridCommand Icon="NoteEdit" CommandName="Edit" Text="编辑" />
                                <ext:GridCommand Icon="Delete" CommandName="Delete" Text="删除" />
                            </Commands>
                        </ext:CommandColumn>
                    </Columns>
                </ColumnModel>
                <SelectionModel>
                    <ext:RowSelectionModel ID="RowSelectionModel4" runat="server" SingleSelect="true">
                    </ext:RowSelectionModel>
                </SelectionModel>
                <LoadMask ShowMask="true" Msg="正在加载数据……" />
                <TopBar>
                    <ext:Toolbar ID="Toolbar4" runat="server">
                        <Items>
                            <ext:ToolbarFill ID="ToolbarFill4" runat="server" />
                            <ext:Button ID="Button23" runat="server" Text="新建" Icon="Add">
                                <Listeners>
                                    <Click Handler="NewData(fpServerConfig,winServerConfig,gpServerConfig)" />
                                </Listeners>
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <BottomBar>
                    <ext:PagingToolbar ID="PagingToolbar2" runat="server" PageSize="25">
                        <Items>
                            <ext:ToolbarSpacer ID="ToolbarSpacer7" runat="server" Width="10" />
                            <ext:Label ID="Label4" runat="server" Text="分页大小:" />
                            <ext:ToolbarSpacer ID="ToolbarSpacer8" runat="server" Width="5" />
                            <ext:ComboBox ID="ComboBox4" runat="server" Width="80">
                                <Items>
                                    <ext:ListItem Text="10" />
                                    <ext:ListItem Text="15" />
                                    <ext:ListItem Text="25" />
                                </Items>
                                <SelectedItem Value="10" />
                                <Listeners>
                                    <Select Handler="#{PagingToolbar2}.pageSize = parseInt(this.getValue()); #{PagingToolbar2}.doLoad();" />
                                </Listeners>
                            </ext:ComboBox>
                        </Items>
                    </ext:PagingToolbar>
                </BottomBar>
                <Listeners>
                    <Command Handler="GridPanelRowCommand(this,command, record,fpServerConfig,winServerConfig);" />
                </Listeners>
            </ext:GridPanel>
        </Items>
    </ext:Viewport>
    <ext:Window runat="server" ID="winServerConfig" Title="服务器 - 编辑/详情" Icon="Pencil"
        Modal="true" Width="800" Hidden="true" Height="470">
        <Content>
            <ext:FormPanel ID="fpServerConfig" Frame="true" LabelAlign="Right" runat="server"
                Padding="10">
                <Items>
                    <ext:TextField runat="server" DataIndex="MemuId" Hidden="true" Text="0" />
                    <ext:TextField runat="server" AnchorHorizontal="100%" FieldLabel="型号" DataIndex="Name" />
                    <ext:Checkbox runat="server"  FieldLabel="特价" DataIndex="IsSpecials" />
                    <ext:Checkbox runat="server"  FieldLabel="推荐" DataIndex="IsRecommend" />                  
                    <ext:TextField runat="server" AnchorHorizontal="100%" FieldLabel="促销价" DataIndex="PromotionalPrice" />
                    <ext:TextField runat="server" AnchorHorizontal="100%" FieldLabel="CPU" DataIndex="CPU" />
                    <ext:TextField runat="server" AnchorHorizontal="100%" FieldLabel="内存" DataIndex="RAM" />
                    <ext:TextField runat="server" AnchorHorizontal="100%" FieldLabel="硬盘" DataIndex="HD" />                    
                    <ext:TextField runat="server" AnchorHorizontal="100%" FieldLabel="Ip数" DataIndex="IpRange" />
                    <ext:TextField runat="server" AnchorHorizontal="100%" FieldLabel="排序索引" DataIndex="SortIndex" DefaultAnchor="0" AllowBlank="false" Text="0"
                        Regex="^[0-9]\d*$" />
                    <ext:TextField runat="server" AnchorHorizontal="100%" FieldLabel="单价" DataIndex="UnitPrice" />
                    <ext:TextField runat="server" AnchorHorizontal="100%" FieldLabel="月流量" DataIndex="MonthlyFlow" />
                    <ext:TextField runat="server" AnchorHorizontal="100%" FieldLabel="宽带" DataIndex="Broadband" />
                    <ext:TextField runat="server" AnchorHorizontal="100%" FieldLabel="备注" DataIndex="Memo"/>
                </Items>
            </ext:FormPanel>
        </Content>
        <Buttons>
            <ext:Button ID="Button17" runat="server" Text="保存" Icon="Disk">
                <Listeners>
                    <Click Handler="#{fpServerConfig}.getForm().updateRecord(fpServerConfig.record); SaveData(4,fpServerConfig,false,winServerConfig,gpServerConfig) ;" />
                </Listeners>
            </ext:Button>
            <ext:Button ID="Button18" runat="server" Text="新建" Icon="UserAdd">
                <Listeners>
                    <Click Handler="SaveData(4,fpServerConfig,true,winServerConfig,gpServerConfig) ;" />
                </Listeners>
            </ext:Button>
            <ext:Button ID="Button19" runat="server" Text="重置">
                <Listeners>
                    <Click Handler="#{fpServerConfig}.getForm().reset();" />
                </Listeners>
            </ext:Button>
        </Buttons>
    </ext:Window>
    </form>
</body>
</html>
